/*
 * Decompiled with CFR 0.150.
 * 
 * Could not load the following classes:
 *  cn.hutool.core.date.DateUtil
 *  cn.hutool.core.util.ObjectUtil
 *  com.alibaba.fastjson.JSON
 *  de.felixroske.jfxsupport.FXMLController
 *  javafx.beans.value.ChangeListener
 *  javafx.beans.value.ObservableValue
 *  javafx.collections.FXCollections
 *  javafx.collections.ObservableList
 *  javafx.event.ActionEvent
 *  javafx.event.EventHandler
 *  javafx.fxml.FXML
 *  javafx.fxml.Initializable
 *  javafx.scene.Node
 *  javafx.scene.control.Alert
 *  javafx.scene.control.Alert$AlertType
 *  javafx.scene.control.Button
 *  javafx.scene.control.ComboBox
 *  javafx.scene.control.ScrollPane
 *  javafx.scene.control.TableCell
 *  javafx.scene.control.TableColumn
 *  javafx.scene.control.TableView
 *  javafx.scene.control.TextField
 *  javafx.scene.control.cell.PropertyValueFactory
 *  javafx.scene.input.KeyCode
 *  javafx.scene.input.KeyEvent
 *  javafx.scene.layout.AnchorPane
 *  javafx.scene.layout.VBox
 *  javafx.stage.Modality
 *  javafx.stage.Stage
 *  javafx.util.Callback
 *  org.springframework.beans.factory.annotation.Autowired
 */
package com.gys.controller.acceptPo;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.gys.GysApplication;
import com.gys.common.business.AcceptUtil;
import com.gys.common.data.HttpJson;
import com.gys.common.data.KeyValue;
import com.gys.common.util.CacheUtil;
import com.gys.common.util.CommonUtil;
import com.gys.common.util.ConstUtil;
import com.gys.common.util.SpringUtil;
import com.gys.controller.BaseController;
import com.gys.controller.acceptPo.AcceptPoController;
import com.gys.controller.acceptPo.AddProductController;
import com.gys.controller.acceptPo.AddTypeController;
import com.gys.controller.index.IndexController;
import com.gys.data.accept.AcceptInData;
import com.gys.data.accept.GaiaTaxCode;
import com.gys.data.accept.GetPoDetailInData;
import com.gys.data.accept.GetPoInData;
import com.gys.data.accept.GetSupOutData;
import com.gys.data.accept.ProductOutData;
import com.gys.data.example.GetLoginStoreOutData;
import com.gys.data.example.GetUserOutData;
import com.gys.view.acceptPo.AddView;
import com.gys.view.acceptPo.ChooseProduct;
import de.felixroske.jfxsupport.FXMLController;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.ResourceBundle;
import java.util.Timer;
import java.util.TimerTask;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.VBox;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.util.Callback;
import org.springframework.beans.factory.annotation.Autowired;

@FXMLController
public class AddPoController
extends BaseController
implements Initializable {
    private final int pageSize = ConstUtil.DEFAULT_PAGESIZE;
    private final int defaultPageCount = ConstUtil.DEFAULT_PAGECOUNT;
    private ObservableList<GetPoDetailInData> detailObservableTableList = FXCollections.observableArrayList(new ArrayList());
    @FXML
    private AnchorPane anchorPane;
    @FXML
    private ScrollPane scrollPane;
    @FXML
    private VBox vBox;
    @FXML
    private Button enterBtn;
    @FXML
    private TextField orderType;
    @FXML
    private ComboBox<KeyValue> store;
    @FXML
    private TextField date;
    @FXML
    private TextField storeText;
    @FXML
    private TextField storeType;
    @FXML
    private TextField clientName;
    @FXML
    private TextField pay;
    @FXML
    private TextField totalAmount;
    @FXML
    private TextField headRemark;
    @FXML
    private TableView<GetPoDetailInData> tableView;
    @FXML
    private TableColumn<GetPoDetailInData, String> indexNo;
    @FXML
    private TableColumn<GetPoDetailInData, String> proCode;
    @FXML
    private TableColumn<GetPoDetailInData, String> proName;
    @FXML
    private TableColumn<GetPoDetailInData, String> proUnit;
    @FXML
    private TableColumn<GetPoDetailInData, String> proPrice;
    @FXML
    private TableColumn<GetPoDetailInData, String> proRate;
    @FXML
    private TableColumn<GetPoDetailInData, String> proQty;
    @FXML
    private TableColumn<GetPoDetailInData, String> proPlace;
    @FXML
    private TableColumn<GetPoDetailInData, String> proKuwei;
    @FXML
    private TableColumn<GetPoDetailInData, String> proDate;
    @FXML
    private TableColumn<GetPoDetailInData, String> remark;
    @Autowired
    private AcceptPoController acceptPoController;
    @Autowired
    private AddTypeController addTypeController;
    @Autowired
    private AddProductController addProductController;
    @Autowired
    private IndexController indexController;
    private ObservableList<KeyValue> storeOptions;
    private ObservableList<KeyValue> taxOptions;
    private List<GetSupOutData> items = new ArrayList<GetSupOutData>();

    public void initialize(URL location, ResourceBundle resources) {
        this.scrollPane.setPrefWidth(this.getContentWidth());
        this.scrollPane.setPrefHeight(this.getContentHeight());
        this.vBox.setPrefWidth(this.getContentWidth());
        this.vBox.setPrefHeight(this.getContentHeight());
        this.tableView.setPrefWidth(this.getContentWidth());
        this.init();
    }

    @Override
    public void init() {
        if (ObjectUtil.isEmpty(this.anchorPane)) {
            return;
        }
        new Timer().schedule(new TimerTask(){

            @Override
            public void run() {
                AddView view = SpringUtil.getBean(AddView.class);
                Stage stage = (Stage)view.getView().getScene().getWindow();
                stage.getScene().setOnKeyReleased((EventHandler)new EventHandler<KeyEvent>(){

                    public void handle(KeyEvent event) {
                        if (event.getCode() == KeyCode.ENTER) {
                            AddPoController.this.saveAdd();
                            return;
                        }
                        if (event.getCode() == KeyCode.ESCAPE) {
                            AddPoController.this.closeWindows();
                            return;
                        }
                    }
                });
            }
        }, 1000L);
        AcceptInData inDataStore = new AcceptInData();
        HttpJson httpJsonS = AcceptUtil.getSup(inDataStore);
        if (!httpJsonS.isSuccess()) {
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", httpJsonS.getMsg());
            alert.showAndWait();
            return;
        }
        this.items = JSON.parseArray((String)httpJsonS.getMsg(), GetSupOutData.class);
        ArrayList<KeyValue> storeOptionList = new ArrayList<KeyValue>();
        for (GetSupOutData item : this.items) {
            storeOptionList.add(new KeyValue(item.getSupName(), item.getSupCode()));
        }
        this.storeOptions = FXCollections.observableArrayList(storeOptionList);
        this.store.setItems(this.storeOptions);
        CommonUtil.comboxInit(this.store);
        this.store.setOnAction(e -> {
            String value = ((KeyValue)this.store.getValue()).getValue();
            for (GetSupOutData item : this.items) {
                if (!value.equals(item.getSupCode())) continue;
                this.pay.setText(item.getPayTerm());
            }
        });
        AcceptInData inData = new AcceptInData();
        HttpJson httpJson = AcceptUtil.getTax(inData);
        List<GaiaTaxCode> itemList = new ArrayList();
        if (!httpJson.isSuccess()) {
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", httpJsonS.getMsg());
            alert.showAndWait();
            return;
        }
        itemList = JSON.parseArray((String)httpJson.getMsg(), GaiaTaxCode.class);
        ArrayList<KeyValue> taxOptionList = new ArrayList<KeyValue>();
        for (GaiaTaxCode item : itemList) {
            taxOptionList.add(new KeyValue(item.getTaxCodeValue(), item.getTaxCode()));
        }
        this.taxOptions = FXCollections.observableArrayList(taxOptionList);
        this.clientName.setText(((GetUserOutData)CacheUtil.get("logInUser")).getClient());
        this.orderType.setText("\u91c7\u8d2d\u8ba2\u5355");
        this.date.setText(DateUtil.format((Date)new Date(), (String)"yyyyMMdd"));
        this.storeText.setText(((GetLoginStoreOutData)CacheUtil.get("store")).getStoName());
        this.storeType.setText("\u95e8\u5e97");
        this.totalAmount.setText("0.00");
        this.detailObservableTableList.clear();
        this.store.setValue(null);
        this.headRemark.setText("");
    }

    @FXML
    private void choose() {
        this.addProductController.init();
        GysApplication.showView(ChooseProduct.class, (Modality)Modality.APPLICATION_MODAL);
    }

    @FXML
    private void saveAdd() {
        if (ObjectUtil.isNull(this.store.getValue())) {
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", "\u8bf7\u9009\u62e9\u4f9b\u5e94\u5546");
            alert.showAndWait();
            return;
        }
        if (this.detailObservableTableList.size() == 0) {
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", "\u8bf7\u6dfb\u52a0\u5546\u54c1");
            alert.showAndWait();
            return;
        }
        for (int i = 0; i < this.detailObservableTableList.size(); ++i) {
            if (ObjectUtil.isEmpty(((GetPoDetailInData)this.detailObservableTableList.get(i)).getProQty())) {
                Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", "\u8bf7\u586b\u5199\u6570\u91cf");
                alert.showAndWait();
                return;
            }
            if (ObjectUtil.isEmpty(((GetPoDetailInData)this.detailObservableTableList.get(i)).getProPrice())) {
                Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", "\u8bf7\u586b\u5199\u5355\u4ef7");
                alert.showAndWait();
                return;
            }
            if (!ObjectUtil.isEmpty(((GetPoDetailInData)this.detailObservableTableList.get(i)).getProRate())) continue;
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", "\u8bf7\u9009\u62e9\u7a0e\u7387");
            alert.showAndWait();
            return;
        }
        GetPoInData inData = new GetPoInData();
        inData.setPaymentId(this.pay.getText());
        inData.setStoreCode(((KeyValue)this.store.getValue()).getValue());
        inData.setRemark(this.headRemark.getText());
        inData.setPoDetailList((List<GetPoDetailInData>)this.detailObservableTableList);
        HttpJson httpJson = AcceptUtil.insertPo(inData);
        if (httpJson.isSuccess()) {
            String poId = httpJson.getMsg();
            AcceptInData acceptInData = new AcceptInData();
            acceptInData.setGsahPoid(poId);
            acceptInData.setGsahBrId(((GetLoginStoreOutData)CacheUtil.get("store")).getStoCode());
            acceptInData.setGsahFrom(((KeyValue)this.store.getValue()).getValue());
            HttpJson rsp = AcceptUtil.savePo(acceptInData);
            if (rsp.isSuccess()) {
                Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", "\u4fdd\u5b58\u6210\u529f");
                alert.showAndWait();
                this.closeWindows();
                this.acceptPoController.initTable(0, poId);
                this.anchorPane.getScene().getWindow().hide();
            }
        } else {
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", httpJson.getMsg());
            alert.showAndWait();
        }
    }

    @FXML
    public TableView<GetPoDetailInData> addProduct(ProductOutData product) {
        GetPoDetailInData data = new GetPoDetailInData();
        int index = this.detailObservableTableList.size();
        data.setIndexNo(String.valueOf(index + 1));
        data.setProCode(product.getProCode());
        data.setProName(product.getGspgProName());
        data.setProPlace(((GetLoginStoreOutData)CacheUtil.get("store")).getStoName());
        data.setProUnit(product.getProUnit());
        data.setProKuwei("\u5408\u683c");
        data.setProDate(DateUtil.format((Date)new Date(), (String)"yyyyMMdd"));
        this.detailObservableTableList.add(data);
        this.bingDetailTableCell();
        this.changeToTextFieldDEdit(this.proPrice);
        this.changeToTextFieldDEdit(this.proQty);
        this.changeToTextFieldDEdit(this.remark);
        this.changeToComBoxEdit(this.proRate);
        this.tableView.setItems(this.detailObservableTableList);
        return this.tableView;
    }

    @FXML
    private void closeWindows() {
        this.anchorPane.getScene().getWindow().hide();
    }

    private void bingDetailTableCell() {
        this.indexNo.setCellValueFactory((Callback)new PropertyValueFactory(this.indexNo.getId()));
        this.proCode.setCellValueFactory((Callback)new PropertyValueFactory(this.proCode.getId()));
        this.proName.setCellValueFactory((Callback)new PropertyValueFactory(this.proName.getId()));
        this.proUnit.setCellValueFactory((Callback)new PropertyValueFactory(this.proUnit.getId()));
        this.proPrice.setCellValueFactory((Callback)new PropertyValueFactory(this.proPrice.getId()));
        this.proRate.setCellValueFactory((Callback)new PropertyValueFactory(this.proRate.getId()));
        this.proQty.setCellValueFactory((Callback)new PropertyValueFactory(this.proQty.getId()));
        this.proPlace.setCellValueFactory((Callback)new PropertyValueFactory(this.proPlace.getId()));
        this.proKuwei.setCellValueFactory((Callback)new PropertyValueFactory(this.proKuwei.getId()));
        this.proDate.setCellValueFactory((Callback)new PropertyValueFactory(this.proDate.getId()));
        this.remark.setCellValueFactory((Callback)new PropertyValueFactory(this.remark.getId()));
    }

    public void changeToComBoxEdit(TableColumn<GetPoDetailInData, String> column) {
        column.setCellFactory(tc -> {
            final ComboBox combo = new ComboBox();
            combo.setItems(this.taxOptions);
            combo.setEditable(false);
            combo.setMinHeight(30.0);
            combo.setPrefWidth(150.0);
            CommonUtil.comboxInit(combo);
            TableCell<GetPoDetailInData, String> cell = new TableCell<GetPoDetailInData, String>(){

                protected void updateItem(String chuzhi, boolean empty) {
                    super.updateItem(chuzhi, empty);
                    if (empty) {
                        this.setGraphic(null);
                    } else {
                        this.setGraphic((Node)combo);
                    }
                }
            };
            combo.setOnAction(arg_0 -> this.lambda$null$1((TableCell)cell, combo, (ActionEvent) arg_0));
            return cell;
        });
    }

    public void changeToTextFieldDEdit(TableColumn<GetPoDetailInData, String> column) {
        column.setCellFactory(tc -> {
            final TextField textField = new TextField();
            TableCell<GetPoDetailInData, String> cell = new TableCell<GetPoDetailInData, String>(){

                protected void updateItem(String chuzhi, boolean empty) {
                    super.updateItem(chuzhi, empty);
                    if (empty) {
                        this.setGraphic(null);
                    } else {
                        textField.setText(chuzhi);
                        this.setGraphic((Node)textField);
                    }
                }
            };
            textField.textProperty().addListener(new ChangeListener(){
                final TableCell val_cell;
                final TextField val_textField;
                {
                    this.val_cell = cell;
                    this.val_textField = textField;
                }

                public void changed(ObservableValue observable, Object oldValue, Object newValue) {
                    int rank = this.val_cell.getIndex();
                    String cloumName = this.val_cell.getId();
                    String value = this.val_textField.getText();
                    GetPoDetailInData outData = (GetPoDetailInData)AddPoController.this.detailObservableTableList.get(rank);
                    String methodName = CommonUtil.getSetMethod(cloumName);
                    try {
                        Method method = GetPoDetailInData.class.getMethod(methodName, String.class);
                        method.invoke(outData, value);
                    }
                    catch (Exception ex) {
                        throw new RuntimeException("\u6ca1\u6709\u65b9\u6cd5" + methodName);
                    }
                }
            });
            return cell;
        });
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public int getDefaultPageCount() {
        return this.defaultPageCount;
    }

    public ObservableList<GetPoDetailInData> getDetailObservableTableList() {
        return this.detailObservableTableList;
    }

    public AnchorPane getAnchorPane() {
        return this.anchorPane;
    }

    public ScrollPane getScrollPane() {
        return this.scrollPane;
    }

    public VBox getVBox() {
        return this.vBox;
    }

    public Button getEnterBtn() {
        return this.enterBtn;
    }

    public TextField getOrderType() {
        return this.orderType;
    }

    public ComboBox<KeyValue> getStore() {
        return this.store;
    }

    public TextField getDate() {
        return this.date;
    }

    public TextField getStoreText() {
        return this.storeText;
    }

    public TextField getStoreType() {
        return this.storeType;
    }

    public TextField getClientName() {
        return this.clientName;
    }

    public TextField getPay() {
        return this.pay;
    }

    public TextField getTotalAmount() {
        return this.totalAmount;
    }

    public TextField getHeadRemark() {
        return this.headRemark;
    }

    public TableView<GetPoDetailInData> getTableView() {
        return this.tableView;
    }

    public TableColumn<GetPoDetailInData, String> getIndexNo() {
        return this.indexNo;
    }

    public TableColumn<GetPoDetailInData, String> getProCode() {
        return this.proCode;
    }

    public TableColumn<GetPoDetailInData, String> getProName() {
        return this.proName;
    }

    public TableColumn<GetPoDetailInData, String> getProUnit() {
        return this.proUnit;
    }

    public TableColumn<GetPoDetailInData, String> getProPrice() {
        return this.proPrice;
    }

    public TableColumn<GetPoDetailInData, String> getProRate() {
        return this.proRate;
    }

    public TableColumn<GetPoDetailInData, String> getProQty() {
        return this.proQty;
    }

    public TableColumn<GetPoDetailInData, String> getProPlace() {
        return this.proPlace;
    }

    public TableColumn<GetPoDetailInData, String> getProKuwei() {
        return this.proKuwei;
    }

    public TableColumn<GetPoDetailInData, String> getProDate() {
        return this.proDate;
    }

    public TableColumn<GetPoDetailInData, String> getRemark() {
        return this.remark;
    }

    public AcceptPoController getAcceptPoController() {
        return this.acceptPoController;
    }

    public AddTypeController getAddTypeController() {
        return this.addTypeController;
    }

    public AddProductController getAddProductController() {
        return this.addProductController;
    }

    public IndexController getIndexController() {
        return this.indexController;
    }

    public ObservableList<KeyValue> getStoreOptions() {
        return this.storeOptions;
    }

    public ObservableList<KeyValue> getTaxOptions() {
        return this.taxOptions;
    }

    public List<GetSupOutData> getItems() {
        return this.items;
    }

    public void setDetailObservableTableList(ObservableList<GetPoDetailInData> detailObservableTableList) {
        this.detailObservableTableList = detailObservableTableList;
    }

    public void setAnchorPane(AnchorPane anchorPane) {
        this.anchorPane = anchorPane;
    }

    public void setScrollPane(ScrollPane scrollPane) {
        this.scrollPane = scrollPane;
    }

    public void setVBox(VBox vBox) {
        this.vBox = vBox;
    }

    public void setEnterBtn(Button enterBtn) {
        this.enterBtn = enterBtn;
    }

    public void setOrderType(TextField orderType) {
        this.orderType = orderType;
    }

    public void setStore(ComboBox<KeyValue> store) {
        this.store = store;
    }

    public void setDate(TextField date) {
        this.date = date;
    }

    public void setStoreText(TextField storeText) {
        this.storeText = storeText;
    }

    public void setStoreType(TextField storeType) {
        this.storeType = storeType;
    }

    public void setClientName(TextField clientName) {
        this.clientName = clientName;
    }

    public void setPay(TextField pay2) {
        this.pay = pay2;
    }

    public void setTotalAmount(TextField totalAmount) {
        this.totalAmount = totalAmount;
    }

    public void setHeadRemark(TextField headRemark) {
        this.headRemark = headRemark;
    }

    public void setTableView(TableView<GetPoDetailInData> tableView) {
        this.tableView = tableView;
    }

    public void setIndexNo(TableColumn<GetPoDetailInData, String> indexNo) {
        this.indexNo = indexNo;
    }

    public void setProCode(TableColumn<GetPoDetailInData, String> proCode) {
        this.proCode = proCode;
    }

    public void setProName(TableColumn<GetPoDetailInData, String> proName) {
        this.proName = proName;
    }

    public void setProUnit(TableColumn<GetPoDetailInData, String> proUnit) {
        this.proUnit = proUnit;
    }

    public void setProPrice(TableColumn<GetPoDetailInData, String> proPrice) {
        this.proPrice = proPrice;
    }

    public void setProRate(TableColumn<GetPoDetailInData, String> proRate) {
        this.proRate = proRate;
    }

    public void setProQty(TableColumn<GetPoDetailInData, String> proQty) {
        this.proQty = proQty;
    }

    public void setProPlace(TableColumn<GetPoDetailInData, String> proPlace) {
        this.proPlace = proPlace;
    }

    public void setProKuwei(TableColumn<GetPoDetailInData, String> proKuwei) {
        this.proKuwei = proKuwei;
    }

    public void setProDate(TableColumn<GetPoDetailInData, String> proDate) {
        this.proDate = proDate;
    }

    public void setRemark(TableColumn<GetPoDetailInData, String> remark) {
        this.remark = remark;
    }

    public void setAcceptPoController(AcceptPoController acceptPoController) {
        this.acceptPoController = acceptPoController;
    }

    public void setAddTypeController(AddTypeController addTypeController) {
        this.addTypeController = addTypeController;
    }

    public void setAddProductController(AddProductController addProductController) {
        this.addProductController = addProductController;
    }

    public void setIndexController(IndexController indexController) {
        this.indexController = indexController;
    }

    public void setStoreOptions(ObservableList<KeyValue> storeOptions) {
        this.storeOptions = storeOptions;
    }

    public void setTaxOptions(ObservableList<KeyValue> taxOptions) {
        this.taxOptions = taxOptions;
    }

    public void setItems(List<GetSupOutData> items) {
        this.items = items;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof AddPoController)) {
            return false;
        }
        AddPoController other = (AddPoController)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (this.getPageSize() != other.getPageSize()) {
            return false;
        }
        if (this.getDefaultPageCount() != other.getDefaultPageCount()) {
            return false;
        }
        ObservableList<GetPoDetailInData> this$detailObservableTableList = this.getDetailObservableTableList();
        ObservableList<GetPoDetailInData> other$detailObservableTableList = other.getDetailObservableTableList();
        if (this$detailObservableTableList == null ? other$detailObservableTableList != null : !this$detailObservableTableList.equals(other$detailObservableTableList)) {
            return false;
        }
        AnchorPane this$anchorPane = this.getAnchorPane();
        AnchorPane other$anchorPane = other.getAnchorPane();
        if (this$anchorPane == null ? other$anchorPane != null : !this$anchorPane.equals(other$anchorPane)) {
            return false;
        }
        ScrollPane this$scrollPane = this.getScrollPane();
        ScrollPane other$scrollPane = other.getScrollPane();
        if (this$scrollPane == null ? other$scrollPane != null : !this$scrollPane.equals(other$scrollPane)) {
            return false;
        }
        VBox this$vBox = this.getVBox();
        VBox other$vBox = other.getVBox();
        if (this$vBox == null ? other$vBox != null : !this$vBox.equals(other$vBox)) {
            return false;
        }
        Button this$enterBtn = this.getEnterBtn();
        Button other$enterBtn = other.getEnterBtn();
        if (this$enterBtn == null ? other$enterBtn != null : !this$enterBtn.equals(other$enterBtn)) {
            return false;
        }
        TextField this$orderType = this.getOrderType();
        TextField other$orderType = other.getOrderType();
        if (this$orderType == null ? other$orderType != null : !this$orderType.equals(other$orderType)) {
            return false;
        }
        ComboBox<KeyValue> this$store = this.getStore();
        ComboBox<KeyValue> other$store = other.getStore();
        if (this$store == null ? other$store != null : !this$store.equals(other$store)) {
            return false;
        }
        TextField this$date = this.getDate();
        TextField other$date = other.getDate();
        if (this$date == null ? other$date != null : !this$date.equals(other$date)) {
            return false;
        }
        TextField this$storeText = this.getStoreText();
        TextField other$storeText = other.getStoreText();
        if (this$storeText == null ? other$storeText != null : !this$storeText.equals(other$storeText)) {
            return false;
        }
        TextField this$storeType = this.getStoreType();
        TextField other$storeType = other.getStoreType();
        if (this$storeType == null ? other$storeType != null : !this$storeType.equals(other$storeType)) {
            return false;
        }
        TextField this$clientName = this.getClientName();
        TextField other$clientName = other.getClientName();
        if (this$clientName == null ? other$clientName != null : !this$clientName.equals(other$clientName)) {
            return false;
        }
        TextField this$pay = this.getPay();
        TextField other$pay = other.getPay();
        if (this$pay == null ? other$pay != null : !this$pay.equals(other$pay)) {
            return false;
        }
        TextField this$totalAmount = this.getTotalAmount();
        TextField other$totalAmount = other.getTotalAmount();
        if (this$totalAmount == null ? other$totalAmount != null : !this$totalAmount.equals(other$totalAmount)) {
            return false;
        }
        TextField this$headRemark = this.getHeadRemark();
        TextField other$headRemark = other.getHeadRemark();
        if (this$headRemark == null ? other$headRemark != null : !this$headRemark.equals(other$headRemark)) {
            return false;
        }
        TableView<GetPoDetailInData> this$tableView = this.getTableView();
        TableView<GetPoDetailInData> other$tableView = other.getTableView();
        if (this$tableView == null ? other$tableView != null : !this$tableView.equals(other$tableView)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$indexNo = this.getIndexNo();
        TableColumn<GetPoDetailInData, String> other$indexNo = other.getIndexNo();
        if (this$indexNo == null ? other$indexNo != null : !this$indexNo.equals(other$indexNo)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proCode = this.getProCode();
        TableColumn<GetPoDetailInData, String> other$proCode = other.getProCode();
        if (this$proCode == null ? other$proCode != null : !this$proCode.equals(other$proCode)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proName = this.getProName();
        TableColumn<GetPoDetailInData, String> other$proName = other.getProName();
        if (this$proName == null ? other$proName != null : !this$proName.equals(other$proName)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proUnit = this.getProUnit();
        TableColumn<GetPoDetailInData, String> other$proUnit = other.getProUnit();
        if (this$proUnit == null ? other$proUnit != null : !this$proUnit.equals(other$proUnit)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proPrice = this.getProPrice();
        TableColumn<GetPoDetailInData, String> other$proPrice = other.getProPrice();
        if (this$proPrice == null ? other$proPrice != null : !this$proPrice.equals(other$proPrice)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proRate = this.getProRate();
        TableColumn<GetPoDetailInData, String> other$proRate = other.getProRate();
        if (this$proRate == null ? other$proRate != null : !this$proRate.equals(other$proRate)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proQty = this.getProQty();
        TableColumn<GetPoDetailInData, String> other$proQty = other.getProQty();
        if (this$proQty == null ? other$proQty != null : !this$proQty.equals(other$proQty)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proPlace = this.getProPlace();
        TableColumn<GetPoDetailInData, String> other$proPlace = other.getProPlace();
        if (this$proPlace == null ? other$proPlace != null : !this$proPlace.equals(other$proPlace)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proKuwei = this.getProKuwei();
        TableColumn<GetPoDetailInData, String> other$proKuwei = other.getProKuwei();
        if (this$proKuwei == null ? other$proKuwei != null : !this$proKuwei.equals(other$proKuwei)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$proDate = this.getProDate();
        TableColumn<GetPoDetailInData, String> other$proDate = other.getProDate();
        if (this$proDate == null ? other$proDate != null : !this$proDate.equals(other$proDate)) {
            return false;
        }
        TableColumn<GetPoDetailInData, String> this$remark = this.getRemark();
        TableColumn<GetPoDetailInData, String> other$remark = other.getRemark();
        if (this$remark == null ? other$remark != null : !this$remark.equals(other$remark)) {
            return false;
        }
        AcceptPoController this$acceptPoController = this.getAcceptPoController();
        AcceptPoController other$acceptPoController = other.getAcceptPoController();
        if (this$acceptPoController == null ? other$acceptPoController != null : !(this$acceptPoController).equals(other$acceptPoController)) {
            return false;
        }
        AddTypeController this$addTypeController = this.getAddTypeController();
        AddTypeController other$addTypeController = other.getAddTypeController();
        if (this$addTypeController == null ? other$addTypeController != null : !(this$addTypeController).equals(other$addTypeController)) {
            return false;
        }
        AddProductController this$addProductController = this.getAddProductController();
        AddProductController other$addProductController = other.getAddProductController();
        if (this$addProductController == null ? other$addProductController != null : !(this$addProductController).equals(other$addProductController)) {
            return false;
        }
        IndexController this$indexController = this.getIndexController();
        IndexController other$indexController = other.getIndexController();
        if (this$indexController == null ? other$indexController != null : !(this$indexController).equals(other$indexController)) {
            return false;
        }
        ObservableList<KeyValue> this$storeOptions = this.getStoreOptions();
        ObservableList<KeyValue> other$storeOptions = other.getStoreOptions();
        if (this$storeOptions == null ? other$storeOptions != null : !this$storeOptions.equals(other$storeOptions)) {
            return false;
        }
        ObservableList<KeyValue> this$taxOptions = this.getTaxOptions();
        ObservableList<KeyValue> other$taxOptions = other.getTaxOptions();
        if (this$taxOptions == null ? other$taxOptions != null : !this$taxOptions.equals(other$taxOptions)) {
            return false;
        }
        List<GetSupOutData> this$items = this.getItems();
        List<GetSupOutData> other$items = other.getItems();
        return !(this$items == null ? other$items != null : !(this$items).equals(other$items));
    }

    protected boolean canEqual(Object other) {
        return other instanceof AddPoController;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        result = result * 59 + this.getPageSize();
        result = result * 59 + this.getDefaultPageCount();
        ObservableList<GetPoDetailInData> $detailObservableTableList = this.getDetailObservableTableList();
        result = result * 59 + ($detailObservableTableList == null ? 43 : $detailObservableTableList.hashCode());
        AnchorPane $anchorPane = this.getAnchorPane();
        result = result * 59 + ($anchorPane == null ? 43 : $anchorPane.hashCode());
        ScrollPane $scrollPane = this.getScrollPane();
        result = result * 59 + ($scrollPane == null ? 43 : $scrollPane.hashCode());
        VBox $vBox = this.getVBox();
        result = result * 59 + ($vBox == null ? 43 : $vBox.hashCode());
        Button $enterBtn = this.getEnterBtn();
        result = result * 59 + ($enterBtn == null ? 43 : $enterBtn.hashCode());
        TextField $orderType = this.getOrderType();
        result = result * 59 + ($orderType == null ? 43 : $orderType.hashCode());
        ComboBox<KeyValue> $store = this.getStore();
        result = result * 59 + ($store == null ? 43 : $store.hashCode());
        TextField $date = this.getDate();
        result = result * 59 + ($date == null ? 43 : $date.hashCode());
        TextField $storeText = this.getStoreText();
        result = result * 59 + ($storeText == null ? 43 : $storeText.hashCode());
        TextField $storeType = this.getStoreType();
        result = result * 59 + ($storeType == null ? 43 : $storeType.hashCode());
        TextField $clientName = this.getClientName();
        result = result * 59 + ($clientName == null ? 43 : $clientName.hashCode());
        TextField $pay = this.getPay();
        result = result * 59 + ($pay == null ? 43 : $pay.hashCode());
        TextField $totalAmount = this.getTotalAmount();
        result = result * 59 + ($totalAmount == null ? 43 : $totalAmount.hashCode());
        TextField $headRemark = this.getHeadRemark();
        result = result * 59 + ($headRemark == null ? 43 : $headRemark.hashCode());
        TableView<GetPoDetailInData> $tableView = this.getTableView();
        result = result * 59 + ($tableView == null ? 43 : $tableView.hashCode());
        TableColumn<GetPoDetailInData, String> $indexNo = this.getIndexNo();
        result = result * 59 + ($indexNo == null ? 43 : $indexNo.hashCode());
        TableColumn<GetPoDetailInData, String> $proCode = this.getProCode();
        result = result * 59 + ($proCode == null ? 43 : $proCode.hashCode());
        TableColumn<GetPoDetailInData, String> $proName = this.getProName();
        result = result * 59 + ($proName == null ? 43 : $proName.hashCode());
        TableColumn<GetPoDetailInData, String> $proUnit = this.getProUnit();
        result = result * 59 + ($proUnit == null ? 43 : $proUnit.hashCode());
        TableColumn<GetPoDetailInData, String> $proPrice = this.getProPrice();
        result = result * 59 + ($proPrice == null ? 43 : $proPrice.hashCode());
        TableColumn<GetPoDetailInData, String> $proRate = this.getProRate();
        result = result * 59 + ($proRate == null ? 43 : $proRate.hashCode());
        TableColumn<GetPoDetailInData, String> $proQty = this.getProQty();
        result = result * 59 + ($proQty == null ? 43 : $proQty.hashCode());
        TableColumn<GetPoDetailInData, String> $proPlace = this.getProPlace();
        result = result * 59 + ($proPlace == null ? 43 : $proPlace.hashCode());
        TableColumn<GetPoDetailInData, String> $proKuwei = this.getProKuwei();
        result = result * 59 + ($proKuwei == null ? 43 : $proKuwei.hashCode());
        TableColumn<GetPoDetailInData, String> $proDate = this.getProDate();
        result = result * 59 + ($proDate == null ? 43 : $proDate.hashCode());
        TableColumn<GetPoDetailInData, String> $remark = this.getRemark();
        result = result * 59 + ($remark == null ? 43 : $remark.hashCode());
        AcceptPoController $acceptPoController = this.getAcceptPoController();
        result = result * 59 + ($acceptPoController == null ? 43 : ($acceptPoController).hashCode());
        AddTypeController $addTypeController = this.getAddTypeController();
        result = result * 59 + ($addTypeController == null ? 43 : ($addTypeController).hashCode());
        AddProductController $addProductController = this.getAddProductController();
        result = result * 59 + ($addProductController == null ? 43 : ($addProductController).hashCode());
        IndexController $indexController = this.getIndexController();
        result = result * 59 + ($indexController == null ? 43 : ($indexController).hashCode());
        ObservableList<KeyValue> $storeOptions = this.getStoreOptions();
        result = result * 59 + ($storeOptions == null ? 43 : $storeOptions.hashCode());
        ObservableList<KeyValue> $taxOptions = this.getTaxOptions();
        result = result * 59 + ($taxOptions == null ? 43 : $taxOptions.hashCode());
        List<GetSupOutData> $items = this.getItems();
        result = result * 59 + ($items == null ? 43 : ($items).hashCode());
        return result;
    }

    public String toString() {
        return "AddPoController(pageSize=" + this.getPageSize() + ", defaultPageCount=" + this.getDefaultPageCount() + ", detailObservableTableList=" + this.getDetailObservableTableList() + ", anchorPane=" + this.getAnchorPane() + ", scrollPane=" + this.getScrollPane() + ", vBox=" + this.getVBox() + ", enterBtn=" + this.getEnterBtn() + ", orderType=" + this.getOrderType() + ", store=" + this.getStore() + ", date=" + this.getDate() + ", storeText=" + this.getStoreText() + ", storeType=" + this.getStoreType() + ", clientName=" + this.getClientName() + ", pay=" + this.getPay() + ", totalAmount=" + this.getTotalAmount() + ", headRemark=" + this.getHeadRemark() + ", tableView=" + this.getTableView() + ", indexNo=" + this.getIndexNo() + ", proCode=" + this.getProCode() + ", proName=" + this.getProName() + ", proUnit=" + this.getProUnit() + ", proPrice=" + this.getProPrice() + ", proRate=" + this.getProRate() + ", proQty=" + this.getProQty() + ", proPlace=" + this.getProPlace() + ", proKuwei=" + this.getProKuwei() + ", proDate=" + this.getProDate() + ", remark=" + this.getRemark() + ", acceptPoController=" + this.getAcceptPoController() + ", addTypeController=" + this.getAddTypeController() + ", addProductController=" + this.getAddProductController() + ", indexController=" + this.getIndexController() + ", storeOptions=" + this.getStoreOptions() + ", taxOptions=" + this.getTaxOptions() + ", items=" + this.getItems() + ")";
    }

    private void lambda$null$1(TableCell cell, ComboBox combo, ActionEvent e) {
        int rank = cell.getIndex();
        String cloumName = cell.getId();
        String value = ((KeyValue)combo.getValue()).getValue();
        String name = ((KeyValue)combo.getValue()).getName();
        GetPoDetailInData outData = (GetPoDetailInData)this.detailObservableTableList.get(rank);
        String methodName = CommonUtil.getSetMethod(cloumName);
        try {
            Method method = GetPoDetailInData.class.getMethod(methodName, String.class);
            method.invoke(outData, value);
        }
        catch (Exception ex) {
            throw new RuntimeException("\u6ca1\u6709\u65b9\u6cd5" + methodName);
        }
    }
}

